import pytest
import requests
#导入方法
from config import readconfig
#实例化调用
readcon=readconfig.Read()

#类似pytest公共方法-crm实现登录
@pytest.fixture(scope="session")
def testwk():
    date = {
        "username": "17792917751",
        "password": 123456
    }
    #从配置文件里面获取请求的url
    url = readcon.get_crm("cmurl")
    tim=readcon.get_crm("timeout")
    head = {"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"}
    #url=http://182.92.197.48:8082
    cc=requests.post(url+"/login",data=date,headers=head,timeout=int(tim))
    #http://182.92.197.48:8082/login
    getjson = cc.json()
    # 获取token
    adtoken = getjson['Admin-Token']
    return adtoken
#testin()

# #考试系统获取登录公共方法值-了例如：获取cookie
@pytest.fixture(scope="session")
def teststudent():
    print("12333")




